package service;



import java.sql.Connection;
import java.sql.SQLException;

public class UniversityService {
    public boolean add(University university) throws SQLException {
        Connection connection = JdbcHelper.getConn();
        boolean rowAffect = UniversityDao.getInstance().add(university,connection);
        JdbcHelper.close(connection);
        return rowAffect;
    }
    public boolean update(University university) throws SQLException {
        Connection connection = JdbcHelper.getConn();
        boolean rowAffect = UniversityDao.getInstance().update(university);
        JdbcHelper.close(connection);
        return rowAffect;
    }
    public boolean delete(int id) throws SQLException {
        Connection connection = JdbcHelper.getConn();
        boolean rowAffect = UniversityDao.getInstance().delete(id);
        JdbcHelper.close(connection);
        return rowAffect;
    }
}

